Conversation
- Remove copy_rtl_files.cmake and copy_rtl_files.py utilities - Add generate_sources_list.cmake and generate_sources_list.py using slang - Move and update read_rtl_sources.cmake for new source list format - Update SoCMakeConfig.cmake and tests to use new utilities
- Remove vhier.cmake and its inclusion from SoCMakeConfig.cmake - Remove vhier module source files and submodule definitions - Delete vhier test directory, CMakeLists, and golden.xml - Update tests CMakeLists to drop vhier subdirectory
This change follows MR [1] replacing `vhier` tool with `slang`. As the referred MR requires `slang` in version 10.0 and `nixpkgs` currently provides version 9.1 (there is already a pending MR to update `nixpkgs` to version 10.0 [2]), the corresponding nix overlays are used. - Add overlay to override sv-lang with version 10.0 from upstream - Remove custom verilogPerl build and dependency from deps - Update pkgs import to include overlays for sv-lang [1] #198 [2] NixOS/nixpkgs#484982
… files - Generate separate rtl_sources.f and include_sources.f files - Update slang arguments to use --Mmodule and --Minclude options
This change follows MR [1] replacing `vhier` tool with `slang`. As the referred MR requires `slang` in version 10.0 and `nixpkgs` currently provides version 9.1 (there is already a pending MR to update `nixpkgs` to version 10.0 [2]), the corresponding nix overlays are used. - Add overlay to override sv-lang with version 10.0 from upstream - Remove custom verilogPerl build and dependency from deps - Update pkgs import to include overlays for sv-lang [1] #198 [2] NixOS/nixpkgs#484982
|
Hello @adrianf0 , There are 2 ways of going for something like this. Write file list at CMake configure phase (unused files might be present)This approach is much simpler and it works for any file type, not just SV. Generate at build phase, with analyzing the hierarchy.In case this is needed, I support the decision to go for slang in place of vhier. When it comes to the pull request, I have few comments:
I think this probably will work well for your project, but it has some issues with not being generic enough because of assumptions that are made. |
|
Just another comment, we should probably rename it from I don't have yet suggestion for a good name, will think about it. |
|
Just chiming in about the |
…ang invocation in CMake It follows @Risto97 feedback in the MR [1] - Remove generate_sources_list.py and its invocation - Integrate slang command directly into CMake function - Add checks for slang executable and improve error messages - Use add_custom_command and add_custom_target for output generation - Update argument handling for top module and synthesis options [1] #198 (comment)
…ang invocation in CMake It follows @Risto97 feedback in the MR [1] - Remove generate_sources_list.py and its invocation - Integrate slang command directly into CMake function - Add checks for slang executable and improve error messages - Use add_custom_command and add_custom_target for output generation - Update argument handling for top module and synthesis options [1] #198 (comment)
fd56942 to
2bcf95c
Compare
@Risto97 Thanks a lot for your review.
|
|
Hello @adrianf0 , Thank you for making the changes.
I feel like this tool can be used for other purposes than generating file lists for synthesis. In that sense I dont think its necessary to have an explicit argument SYNTHESIS in the CMake function. add_ip(mcu)
ip_compile_definitions(mcu SYSTEMVERILOG -DSYNTHESIS=1)
generate_sources_list(mcu)or add a add_ip(mcu)
generate_sources_list(mcu ARGS -DSIMULATION=1)You can see that this way we have something more flexible that does not limit us to just passing one predefined macro to slang |
…guments It follows @Risto97 feedback in MR [1]. - Introduce SLANG_ARGS keyword argument to pass extra arguments to slang - Remove deprecated SYNTHESIS option and related code - Update argument parsing and variable handling for new option [1] #198 (comment)
@Risto97 Thank you for your feedback and for outlining the two approaches. The second option you described, adding an argument to For example, you can now use: |
There was a problem hiding this comment.
@benoitdenkinger will add a simple test to using slang instead on vhier
Following discussions within the HEP-SoC team at CERN, we decided that instead of copying all RTL sources into a single directory, it is more effective to generate file (
rtl_sources.fandinclude_sources.f) listing references to all source files. Those files can then be used as input for other tools in the flow.Additionally, the
vhiertool previously used for parsing and generating source lists was found to have issues with some SystemVerilog syntax. Therefore, this pull request replacesvhierwith theslangtool (requires version 10).Main changes:
copy_rtl_files.cmakeandcopy_rtl_files.pyutilities.generate_sources_list.cmakeandgenerate_sources_list.pyusingslang.read_rtl_sources.cmakefor the new source list format.SoCMakeConfig.cmake.vhierand all related CMake integration, source files, submodules, and tests